/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ai.gui;

import ai.*;
import ai.io.DataSource;
import java.awt.Dimension;
import java.io.FileNotFoundException;
import java.io.IOException;
import javax.swing.JFrame;

/**
 *
 * @author pjl
 */
public class AIBrainFrame extends JFrame {

    AIModel model;

    public AIBrainFrame(Brain b) throws FileNotFoundException, IOException, Exception {


//        DataSource trainSrc=new RandomInvertingImageSource("train");
//        DataSource testSrc=new RandomInvertingImageSource("t10k");

//          DataSource trainSrc=new RandomishInvertingImageSource("train",6);
//          DataSource testSrc=new RandomInvertingImageSource("t10k");


        final DataSource trainSrc = new ImageLabelDataSource("train");
        final DataSource testSrc = new ImageLabelDataSource("t10k");

        model = new AIModel(b, trainSrc, testSrc);
        AIPanel panel = new AIPanel(model);
        model.getBrain().addObserver(panel);

        setContentPane(panel);
        setTitle(model.getBrain().getName());

        validate();
        pack();
        setVisible(true);



    }

//    @Override
//    public void dispose() {
//        model.dispose();
//        super.dispose();
//    }
}
